import BN from "bn.js";
import { Address } from "web3x-es/address";
import { TransactionReceipt } from "web3x-es/formatters";
import { Contract, ContractOptions, TxCall, TxSend } from "web3x-es/contract";
import { Eth } from "web3x-es/eth";
import abi from "./ConverterAbi";
interface ConverterEvents {
}
interface ConverterEventLogs {
}
interface ConverterTxEventLogs {
}
export interface ConverterTransactionReceipt extends TransactionReceipt<ConverterTxEventLogs> {
}
interface ConverterMethods {
    calcNeededTokensForEther(_dstToken: Address, _etherAmount: number | string | BN): TxCall<string>;
    getTrader(): TxCall<Address>;
    swapEtherToToken(_dstToken: Address): TxSend<ConverterTransactionReceipt>;
    swapTokenToEther(_srcToken: Address, _srcAmount: number | string | BN, _maxDstAmount: number | string | BN): TxSend<ConverterTransactionReceipt>;
}
export interface ConverterDefinition {
    methods: ConverterMethods;
    events: ConverterEvents;
    eventLogs: ConverterEventLogs;
}
export class Converter extends Contract<ConverterDefinition> {
    constructor(eth: Eth, address?: Address, options?: ContractOptions) {
        super(eth, abi, address, options);
    }
    deploy(_uniswapV2Router: Address): TxSend<ConverterTransactionReceipt> {
        return super.deployBytecode("0x60a060405234801561001057600080fd5b50604051610fa2380380610fa28339818101604052602081101561003357600080fd5b5051606081901b6001600160601b0319166080526001600160a01b0316610f1861008a6000398061016b52806101e6528061029c52806104b552806104ff52806105e152806107ee52806108a45250610f186000f3fe60806040526004361061003f5760003560e01c80633bba21dc146100445780637df493001461009c578063a683beb8146100cd578063b27f823614610105575b600080fd5b34801561005057600080fd5b506100836004803603606081101561006757600080fd5b506001600160a01b03813516906020810135906040013561013e565b6040805192835260208301919091528051918290030190f35b3480156100a857600080fd5b506100b16104b3565b604080516001600160a01b039092168252519081900360200190f35b6100f3600480360360208110156100e357600080fd5b50356001600160a01b03166104d7565b60408051918252519081900360200190f35b34801561011157600080fd5b506100f36004803603604081101561012857600080fd5b506001600160a01b038135169060200135610798565b60008061015c6001600160a01b03861633308763ffffffff610a3616565b6101966001600160a01b0386167f00000000000000000000000000000000000000000000000000000000000000008663ffffffff610a9616565b604080516002808252606080830184529260208301908036833701905050905085816000815181106101c457fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561023d57600080fd5b505afa158015610251573d6000803e3d6000fd5b505050506040513d602081101561026757600080fd5b505181518290600190811061027857fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318cbafe58760008533426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03166001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015610348578181015183820152602001610330565b505050509050019650505050505050600060405180830381600087803b15801561037157600080fd5b505af1158015610385573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156103ae57600080fd5b81019080805160405193929190846401000000008211156103ce57600080fd5b9083019060208201858111156103e357600080fd5b825186602082028301116401000000008211171561040057600080fd5b82525081516020918201928201910280838360005b8381101561042d578181015183820152602001610415565b505050509050016040525050509050848160018151811061044a57fe5b60200260200101511461048e5760405162461bcd60e51b8152600401808060200182810382526028815260200180610e5b6028913960400191505060405180910390fd5b8060018151811061049b57fe5b60200260200101519350600092505050935093915050565b7f000000000000000000000000000000000000000000000000000000000000000090565b60408051600280825260608083018452600093909291906020830190803683370190505090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561055657600080fd5b505afa15801561056a573d6000803e3d6000fd5b505050506040513d602081101561058057600080fd5b50518151829060009061058f57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505082816001815181106105bd57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637ff36ab53460008533426040518663ffffffff1660e01b81526004018085815260200180602001846001600160a01b03166001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561068757818101518382015260200161066f565b50505050905001955050505050506000604051808303818588803b1580156106ae57600080fd5b505af11580156106c2573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f1916820160405260208110156106ec57600080fd5b810190808051604051939291908464010000000082111561070c57600080fd5b90830190602082018581111561072157600080fd5b825186602082028301116401000000008211171561073e57600080fd5b82525081516020918201928201910280838360005b8381101561076b578181015183820152602001610753565b5050505090500160405250505090508060018151811061078757fe5b602002602001015192505050919050565b604080516002808252606080830184526000939092919060208301908036833701905050905083816000815181106107cc57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561084557600080fd5b505afa158015610859573d6000803e3d6000fd5b505050506040513d602081101561086f57600080fd5b505181518290600190811061088057fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631f00ca7485846040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015610928578181015183820152602001610910565b50505050905001935050505060006040518083038186803b15801561094c57600080fd5b505afa158015610960573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561098957600080fd5b81019080805160405193929190846401000000008211156109a957600080fd5b9083019060208201858111156109be57600080fd5b82518660208202830111640100000000821117156109db57600080fd5b82525081516020918201928201910280838360005b83811015610a085781810151838201526020016109f0565b50505050905001604052505050905080600081518110610a2457fe5b60200260200101519250505092915050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610a90908590610bae565b50505050565b801580610b1c575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015610aee57600080fd5b505afa158015610b02573d6000803e3d6000fd5b505050506040513d6020811015610b1857600080fd5b5051155b610b575760405162461bcd60e51b8152600401808060200182810382526036815260200180610ead6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052610ba9908490610bae565b505050565b6060610c03826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c5f9092919063ffffffff16565b805190915015610ba957808060200190516020811015610c2257600080fd5b5051610ba95760405162461bcd60e51b815260040180806020018281038252602a815260200180610e83602a913960400191505060405180910390fd5b6060610c6e8484600085610c76565b949350505050565b6060610c8185610e21565b610cd2576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310610d115780518252601f199092019160209182019101610cf2565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610d73576040519150601f19603f3d011682016040523d82523d6000602084013e610d78565b606091505b50915091508115610d8c579150610c6e9050565b805115610d9c5780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610de6578181015183820152602001610dce565b50505050905090810190601f168015610e135780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590610c6e57505015159291505056fe556e69737761705632436f6e7665727465723a20546f6b656e203c3e204574686572206572726f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220f83cdcde23d6641a68a717b1a95057c921492f14dc3b067f6e3549e83fc6088164736f6c63430006080033", _uniswapV2Router) as any;
    }
}
export var ConverterAbi = abi;
